package ru.kreda.webapp.client.ui;

import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.widget.Window;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;

/**
 * Диалог для отображения содержимого в виду HTML.
 */
public class HTMLUIDialog extends WindowBasedUIDialog {
	private final String title;
	private final String htmlContent;

	public HTMLUIDialog(String title, String htmlContent) {
		this.title = title;
		this.htmlContent = htmlContent;
		setSize(500, 300);
	}

	@Override
	protected Window create() {
		Window window = new Window();
		window.setHeading(title);
		window.setFrame(true);
		window.setModal(true);
		window.setBlinkModal(true);
		window.setBodyBorder(false);
		window.setLayout(new FitLayout());
		window.setButtonAlign(HorizontalAlignment.CENTER);
		window.addText(htmlContent);
		return window;
	}

}
